package com.shux.dubbo.test;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.alibaba.dubbo.config.annotation.Reference;
import com.shux.redis.biz.IRedisBiz;

/**
 **********************************************
 *  描述：
 * Simba.Hua
 * 2017年8月17日
 **********************************************
**/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(value = {"classpath:dubbo-consumer-beans.xml"})
public class DubboConsumer {
    private @Autowired IRedisBiz<String> redisBiz;
 /*   public static void main(String [] args){
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:dubbo-consumer-beans.xml");
        IRedisBiz<String> redisBiz = context.getBean("redisBiz", IRedisBiz.class);
        redisBiz.set("username", "Simba");
        System.out.println(redisBiz.get("username"));
    }*/
    @Test
    public void testConsumer(){
        redisBiz.set("username", "Simba");
        System.out.println(redisBiz.get("username"));
    }
    public IRedisBiz<String> getRedisBiz() {
        return redisBiz;
    }
    public void setRedisBiz(IRedisBiz<String> redisBiz) {
        this.redisBiz = redisBiz;
    }
    
}
